/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-03-20
 * Time: 20:54
 */

class Animal{
    private String name;
    private int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void eat(){
        System.out.println(name+"在吃饭");
    }
}

class Dog extends Animal{

    public Dog(String name, int age) {
        super(name, age);
    }
    public void eat(){
        System.out.println(super.getName()+"汪汪汪！");
    }
}
class Cat extends Animal{
    public Cat(String name,int age){
        super(name,age);
    }
    public void eat(){
        System.out.println(super.getName()+"喵喵喵！");
    }
}
public class Test {
    public static void main(String[] args) {
        Cat cat = new Cat("咪咪",3);
        cat.eat();
        System.out.println("==================");
        Dog dog = new Dog("小灰灰",4);
        dog.eat();
    }
}
